# -*- coding:utf-8 -*-

from com.mat.rpa.utils.globalConstants import GlobalConstants
from com.mat.rpa.views.workWindow.leftPanel.directiveTree import treeItem
from . import dictOperationConstants

class DictOperationSubDirectiveTree(treeItem.TreeItemWithID):
    def __init__(self, parent):
        super(DictOperationSubDirectiveTree, self).__init__(parent)
        self.createDictOperationTreeNode()

    def createDictOperationTreeNode(self):
        self.nodeType = GlobalConstants.treeBranchType
        self.directiveType = "dictOperation"
        self.setText(0,"字典操作")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dictOperationConstants.DictOperationConstants.creatingNewDictDirective, "新建字典")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dictOperationConstants.DictOperationConstants.settingKeyValueDirective, "设置键值对")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dictOperationConstants.DictOperationConstants.gettingValueDirective, "获取键值")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dictOperationConstants.DictOperationConstants.gettingKeyListDirective, "获取字典键名列表")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dictOperationConstants.DictOperationConstants.gettingValueListDirective, "获取字典值列表")
        self.createTreeNode(GlobalConstants.treeLeafType,
                            self, dictOperationConstants.DictOperationConstants.removingKeyValuePairDirective, "删除字典键值对")
